<!-- doUserReg.php 用于将用户输入的注册信息添加到数据库。 -->
<?php
   require_once('inc_admin.php'); 
  //连接数据库		
  connect();

  if(!empty($_FILES["zqy_photo"]["name"])){
  	$zqy_photo = uploadfile('zqy_photo','./upload/',array('jpg','gif','png'));
  }
  else{
  	$zqy_photo='';
  }

  $data = array(
		'zqy_name' => trim($_POST['zqy_name']),  
		'zqy_sex' => $_POST['zqy_sex'],
		'zqy_intro' => $_POST['zqy_intro'],
		'zqy_birth' => $_POST['zqy_birth'],
		'zqy_photo'=>$zqy_photo
  	);

  //执行SQL语句
	$result = add('singer',$data);
  if(!$result){
  	echo "添加失败！<br/>";
  	echo "<a href='addsinger.php'>返回</a>";	  
  }else{	  
 	echo "添加成功！";
	echo "或返回<a href='singerlist.php'>歌手列表</a>页面！";	  
  }    
  
?>